package org.jeecg.common.test;

import lombok.extern.log4j.Log4j;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.lib.SybPayService;

import java.util.Map;
import java.util.logging.Logger;

public class ApiTestV2 {


	public static Map<String,String> Query(String trxid) throws Exception{
		SybPayService service = new SybPayService();
		Map<String, String> map = service.preQuery(trxid, "");
		return map;
	}
	public static Map<String,String>  testFinish(String oldtrxid,String trxamt) throws Exception{
		SybPayService service = new SybPayService();
		String reqsn = String.valueOf(System.currentTimeMillis());
		Map<String, String> map = service.preFinish(oldtrxid, reqsn, trxamt);
		return map;
	}
	public static  Map<String,String> Cancel(String oldtrxid,String trxamt) throws Exception{
		SybPayService service = new SybPayService();
		String reqsn = String.valueOf(System.currentTimeMillis());
		Map<String, String> map = service.preCancel(trxamt, reqsn, oldtrxid);
		return map;
	}


	
	public static void print(Map<String, String> map){
		System.out.println("返回数据如下:");
		if(map!=null){
			for(String key:map.keySet()){
				System.out.println(key+";"+map.get(key));
			}
		}
	}
	
	
}
